import React, {Component} from 'react';

class Login extends Component {

  state = {
    username: ''
  };

  render() {
    let {username} = this.state;
    return (
      <div>
        <h1>登录</h1>

        <input type="text" onChange={(ev)=>{
          this.setState({
            username: ev.target.value
          })
        }}/>

        <button onClick={()=>{
          this.props.changeShowId({
            username,
            showId: 1
          });
        }}>登录</button>
      </div>
    );
  }
}

export default Login;
